package com.chushouya.common.constant;


import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

public enum TipsShowTypeEnum implements IEnum<Integer> {
    TEXT(1, "估价提示语","{\"showType\":1,\"tip\":{\"type\":\"text\",\"content\":\"填写估价提示语\"}}"),
    TEXT_QUESTION(2, "估价提示语 + 问号弹窗提示","{\"showType\":2,\"tip\":{\"type\":\"text\",\"content\":\"填写估价提示语\"},\"popupTips\":[{\"type\":\"text\",\"content\":\"填写弹窗提示语\"},{\"type\":\"image\",\"content\":\"填写弹窗示意图地址\"}]}"),
    QUESTION(3, "问号弹窗提示","{\"showType\":3,\"popupTips\":[{\"type\":\"text\",\"content\":\"填写弹窗提示语\"},{\"type\":\"image\",\"content\":\"填写弹窗示意图地址\"}]}"),
    IMAGE(4, "示意图","{\"showType\":4,\"icon\":{\"type\":\"image\",\"content\":\"填写示意图地址\",\"selectedContent\":\"选中后的示意图地址\"}}"),
    IMAGE_TEXT(5, "示意图 + 估价提示语","{\"showType\":5,\"icon\":{\"type\":\"image\",\"content\":\"填写示意图地址\"},\"tip\":{\"type\":\"text\",\"content\":\"填写估价提示语\"}}"),
    IMAGE_TEXT_QUESTION(6, "示意图 + 估价提示语 + 问号弹窗提示","{\"showType\":6,\"icon\":{\"type\":\"image\",\"content\":\"填写示意图地址\"},\"tip\":{\"type\":\"text\",\"content\":\"填写估价提示语\"},\"popupTips\":[{\"type\":\"text\",\"content\":\"填写弹窗提示语\"},{\"type\":\"image\",\"content\":\"填写弹窗示意图地址\"}]}"),
    DISABLE_BUTTON(7, "置灰选项 + 弹窗 + 估价提示语","{\"showType\":7,\"tip\":{\"type\":\"text\",\"content\":\"填写估价提示语\"},\"popupTips\":[{\"type\":\"text\",\"content\":\"填写弹窗提示语\"}]}"),
    ;

    private Integer value;

    private String desc;

    private String json;

    TipsShowTypeEnum(Integer value, String desc,String json) {
        this.value = value;
        this.desc = desc;
        this.json = json;
    }

    public static String getDesc(Integer value) {
        for (TipsShowTypeEnum thisEnum : TipsShowTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }

    public static String getJson(Integer value) {
        for (TipsShowTypeEnum thisEnum : TipsShowTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.json;
            }
        }
        return Strings.EMPTY;
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }

}
